package com.example.cato_mongodb.entity;


import lombok.AccessLevel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.data.mongodb.core.mapping.Document;



/*
  spring data Mongodb 提供了多个映射的注解
  @Id 将某个属性指名为文档的ID
  @Document 将领域类型声明为到持久化到MongoDB中的文档
  @Filed 指定某个属性持久化到文档中的字段属性
 */
@Data
@RequiredArgsConstructor
@NoArgsConstructor(access = AccessLevel.PRIVATE,force = true)
@Document // 表明Ingredient是个实体文档
public class Ingredient {


    private final String id;

    private final String name;

    private final Type type;


    public static enum  Type{
        WRAP,PROTEIN,VEGGIES,CHEESE,SAUCE
    }

}
